<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="utf-8" />
        <title>CopyButton - ESUI Demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="../dep/esui/3.2.0-beta.2/demo/assets/google-code-prettify/prettify.css"/>
        <link rel="stylesheet" href="assets/themes/standard.css" />
        <!--[if lt IE 9]>
        <link rel="stylesheet" href="../dep/esui/3.2.0-beta.2/demo/assets/ie8.css"/>
        <![endif]-->
    </head>
<body>
    <div class="header">
        <h1 id="branding">ESUI CopyButton</h1>
    </div>
    <div class="ui-g main-container">
        <div id="side-bar" class="ui-u-1-5">
            <ul id="navigator" class="ui-nav">
            </ul>
        </div>
        <div id="main" class="ui-u-4-5">
            <h2>CopyButton</h2>
            <p>Copy到剪切板,调试需要启动EDP Server才能完成flash的初始化。</p>
            <div class="example">
                <div class="row">
                    <div data-ui-id="copyText" data-ui-type="TextBox">
                    </div>
                    <div data-ui-id="copyButtonTest" data-ui-type="CopyButton" class="ui-button ui-button-primary">
                        <span class="ui-icon-copy"></span> Copy
                    </div>
                    <div data-ui-type="TextBox">
                    </div>
                </div>
            </div>
            <script type="text/sample" data-refid="main-js">
            </script>
        </div>
    </div>
    <script src="../../../dep/esui/3.2.0-beta.2/demo/assets/loader/esl.js"></script>
    <script src="config.js"></script>
    <script src="../../../dep/esui/3.2.0-beta.2/demo/demo.js"></script>
    <script src="../../../dep/esui/3.2.0-beta.2/demo/assets/google-code-prettify/prettify.js"></script>
    <script id="main-js">
    require(
        [
            'esui',
            'esui/Toast',
            'CopyButton',
            'demo',
            'esui/Tab',
            'esui/TextBox'
        ],
        function (ui, toast) {
            ui.init();
            var cpButton = ui.get('copyButtonTest');
            var textBox = ui.get('copyText');

            cpButton.on('copy', function () {
                this.content = textBox.getValue();
                toast.success('拷贝成功：' + this.content).show();
            });
        }
    );
    </script>
    <script src="sitemap.js"></script>
</body>
</html>
